package com.tju.resource.tool.tool;

/**
 * @Author HyEISN
 * <p>
 * process value null or other
 */
public class ValueUtil {

    /**
     * return d or 0.0
     */
    public static Double douOrZero(Double d) {
        return null == d ? 0.0 : d;
    }

    /**
     * return i or 0
     */
    public static Integer intOrZero(Integer i) {
        return null == i ? 0 : i;
    }

    /**
     * return s or empty string
     */
    public static String strOrEmp(String s) {
        return null == s || "".equals(s) || s.length() == 0 ? "" : s;
    }
}
